<template>
	<view class="category-nav">
		<view class="section">
			<view class="item" v-for="(item,index) in params" :key="index" @click="util.goToLink(item.link)">
				<image :src="item.icon_url" @error="imageError" class="image"></image>
				<text class="text">{{item.nav_title}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		
		name: 'CategoryNav',
		props: {
			title: {
				type: String,
				default: '图文导航组件'
			},
			type: {
				type: String,
				default: 'category_nav',
			},
			params: {
				type: Array,
				default: [],
			}
		},
		data() {
			return {
				
			}
		},
		created() {
			//console.log(this.params)
			
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">
	.category-nav {
		width: 100%;
		.section {
			width: 100%;
			box-sizing: border-box;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding-top: 16rpx;
			padding-bottom: 16rpx;
			.item {
				flex: 1;
				height: 100%;
				width: 100%;
				display: flex;
				align-items: center;
				flex-direction: column;
				justify-content: center;
				.image {
					width: 84rpx;
					height: 84rpx;
					margin: 0 auto;
					display: block;
				}
				.text {
					font-size: 26rpx;
					font-weight: 500;
					margin-top: 10rpx;
					height: 36rpx;
					line-height: 36rpx;
					color: #666;
					font-family: 'PingFangSC-Medium, PingFang SC';
				}
			}
		}
	}
</style>
